package com.xb.myspring.config;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor;

/**
 * 2BeanDefinitionRegistryPostProcessor
 * 在读取项目中的beanDefinition之后执行，提供一个补充的扩展点
 * 可以在这里动态注册自己的beanDefinition，可以加载classpath之外的bean
 */
public class TestBeanDefinitionRegistryPostProcessor implements BeanDefinitionRegistryPostProcessor {

    @Override
    public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException {
        System.out.println("SpringExtend-2BeanDefinitionRegistryPostProcessor-postProcessBeanDefinitionRegistry");
    }      

    @Override
    public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
        System.out.println("SpringExtend-2BeanDefinitionRegistryPostProcessor-postProcessBeanFactory");
    }      
} 